package com.wehealth.electrocardiograph_two_client.presenter

import android.os.Bundle
import com.wehealth.electrocardiograph_two_client.R
import com.wehealth.electrocardiograph_two_client.activity.AboutActivity
import com.wehealth.three.lib_common.route.RouteFlag
import com.wehealth.three.lib_common.route.RouteHelper

class AboutPresenter(val activity: AboutActivity) {
    private val HTML_URL_INFO = "file:///android_asset/"
    private val HTML_TYPE_INFO = "text"


    fun navigationAgreement() {
        val bundle = Bundle()
        bundle.putString("title", activity.resources.getString(R.string.about_privacy_agreement));
        val fileName = activity.resources.getString(R.string.agreement_file_name);
        bundle.putString("url", HTML_URL_INFO+fileName);
        bundle.putString("type", HTML_TYPE_INFO)
        RouteHelper.startActivity(
            activity,
            destination = RouteFlag.html_page,
            bundle = bundle
        )
    }

    fun finishAbout() {
        activity.finish()
    }
}